import QtQuick 2.12
import QtQuick.Controls 2.12
import Translation 1.0

RadioButton {
    id: cusRadioButtonRoot
    font.family: Translation.family

    //indicator
    property int indicatorWidth: 14

    indicator: Rectangle {
        implicitWidth: indicatorWidth
        implicitHeight: width
        anchors.left: parent.left
        anchors.verticalCenter: parent.verticalCenter
        radius: width / 2
        border.color: cusRadioButtonRoot.checked ? Theme.main_color : "gray"

        Rectangle {
            anchors.fill: parent
            anchors.margins: 3
            width: parent.width * .8
            height: width
            radius: width / 2
            color: Theme.main_color
            visible: cusRadioButtonRoot.checked
        }
    }

    contentItem: Text {
        text: cusRadioButtonRoot.text
        font: cusRadioButtonRoot.font
        opacity: enabled ? 1.0 : 0.3
        color: Theme.text_color
        verticalAlignment: Text.AlignVCenter
        leftPadding: cusRadioButtonRoot.indicator.width / 2 + cusRadioButtonRoot.spacing
    }
}
